home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-11-14 | 4.0 KB | 102 lines | [TEXT/R*ch] |
- // ===========================================================================
- // File: CMPDAGAIndexTab.cp
- // Version: 1.0 - Aug 19, 1996
- // Author: Mike Shields (mshields@inconnect.com)
- //
- // Copyright ©1996 Mike Shields. All rights reserved.
- // I hereby grant users of CMPDAGAIndexTab permission to use it (or any modified
- // version of it) in applications (or any other type of Macintosh software
- // like extensions -- freeware, shareware, commercial, or other) for free,
- // subject to the terms that:
- //
- // (1) This agreement is non-exclusive.
- //
- // (2) I, Mike Shields, retain the copyright to the original source code.
- //
- // These two items are the only required conditions for use. However, I do have
- // an additional request. Note, however, that this is only a request, and
- // that it is not a required condition for use of this code.
- //
- // (1) That I be given credit for CMPDAGAIndexTab code in the copyrights or
- // acknowledgements section of your manual or other appropriate documentation.
- //
- //
- // I would like to repeat that this last item is only a request. You are prefectly
- // free to choose not to do any or all of them.
- //
- // This source code is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- // ===========================================================================
- // CMPDAGAIndexTab.h <- double-click + Command-D to see class declaration
- //
- // A subclass of LAGAIndexTab which has been adapted to work with the MPD classes.
-
- #include "CMPDAGAIndexTab.h"
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::CreateFromStream
- //----------------------------------------------------------------------------------------
- CMPDAGAIndexTab* CMPDAGAIndexTab::CreateFromStream(LStream* inStream)
- {
- return new CMPDAGAIndexTab(inStream);
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::CMPDAGAIndexTab
- //----------------------------------------------------------------------------------------
- CMPDAGAIndexTab::CMPDAGAIndexTab(LStream* inStream)
- : LAGAIndexTab(inStream)
- {
- mTabbedViewID = 0;
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::~CMPDAGAIndexTab
- //----------------------------------------------------------------------------------------
- CMPDAGAIndexTab::~CMPDAGAIndexTab()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::InsertPanelIDs
- //----------------------------------------------------------------------------------------
- void CMPDAGAIndexTab::InsertPanelIDs(MPDPtr inPanelIDData)
- {
- if ( SetTabCount(inPanelIDData->numItems) )
- {
- for ( Int16 i = 0; i < inPanelIDData->numItems; i++ )
- {
- LStr255 tabName(inPanelIDData->MPDList[i].name);
- SetTabTitle(i, tabName);
- }
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::SelectPanelID
- //----------------------------------------------------------------------------------------
- void CMPDAGAIndexTab::SelectPanelID(PanelIDIndexT inPanelID)
- {
- // LAGAIndexTab is 0-based while the MPD classes are 1-based
- SetSelectedTab(inPanelID - 1);
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::GetCurrentPanelID
- //----------------------------------------------------------------------------------------
- PanelIDIndexT CMPDAGAIndexTab::GetCurrentPanelID(void) const
- {
- // LAGAIndexTab is 0-based while the MPD classes are 1-based
- return mSelectedTab + 1;
- }
-
- //----------------------------------------------------------------------------------------
- // CMPDAGAIndexTab::AdaptTab
- //----------------------------------------------------------------------------------------
- void CMPDAGAIndexTab::AdaptTab(Boolean inRefresh)
- {
- ReportPanelIDChanged();
- }
-
-